/*
 * This file is part of CompetitionGenerator.
 * CompetitionGenerator is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * CompetitionGenerator is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * 
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with CompetitionGenerator. If not, see <http://www.gnu.org/licenses/>.
 */
package competitiongenerator.testclasses;

import java.awt.FlowLayout;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JSpinner;
import javax.swing.SpinnerDateModel;

public class NewMain extends JFrame {

    public NewMain() {
        setSize(200, 100);
        setDefaultCloseOperation(EXIT_ON_CLOSE);

        setLayout(new FlowLayout(FlowLayout.LEFT, 4, 4));

        add(new JLabel("Expiration Date:"));
        JSpinner s = new JSpinner(new SpinnerDateModel());
        JSpinner.DateEditor de = new JSpinner.DateEditor(s, "dd/MM/yyyy");
        s.setEditor(de);
        add(s);

        setVisible(true);
        Calendar inst = Calendar.getInstance();
        Date aux = inst.getTime();
        Calendar cal = new GregorianCalendar();
        cal.setTime(aux);
//        cal.add(Calendar.DATE, 31);
        cal.set(Calendar.HOUR, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
        aux = cal.getTime();
        System.out.println(aux);
        
    }

    public static void main(String args[]) {
        new NewMain();
    }
}